<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script src="./Promise.js"></script>

    <script>
      //1. Promise.resolve 
      // let p = Promise.resolve('OK');
      // let p = Promise.resolve(new Promise((resolve, reject) => {
        // resolve('Yes');
        // reject('NoNoNo')
      // }))

      //2. Promise.reject
      // let p = Promise.reject(20);
      // let p = Promise.reject('明天要放假啦~~~我好伤心~~');
      let p = Promise.reject(Promise.resolve('Yes'));

      console.log(p);

    </script>
  </body>
</html>
